<div class="content">
    <div class="layui-card ">
        <div class="search_box">
            <form id="search-form" class="layui-form layui-clear" role="form" data-toggle="validator" method="GET" action="{:url('manage/payslip_detail', ['id' => $payslip.id])}">
                <div class="fsjl_title"><a class="layui-icon layui-icon-left" href="{:url('manage/payslip_list')}"></a>{$payslip.title|htmlentities}</div>
                <div class="search_input">
                    <input type="text" name="keywords" value="{$keywords|htmlentities}" placeholder="请输入员工姓名、手机号搜索" class="layui-input">
                    <button type="submit" class="search_icon iconfont icon-sousuo"></button>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-inline">
                        <select name="status" lay-filter="status">
                            <option value="">请选择状态</option>
                            <option value="1"{if $status == 1} selected{/if}>等待发送</option>
                            <option value="2"{if $status == 2} selected{/if}>发送成功</option>
                            <option value="3"{if $status == 3} selected{/if}>发送失败</option>
                        </select>
                    </div>
                </div>
                <input type="hidden" name="page" value="{$lists.current_page}">
                <div class="but">
                    <a class="layui-btn layui-btn-determine export_but" data-id="{$payslip.id}">导出</a>
                    <a class="layui-btn layui-btn-determine resend_but" data-id="{$payslip.id}">全部重发</a>
                </div>
            </form>
        </div>
        <div class="layui-card-body">
            <table class="layui-table" lay-skin="line" lay-even="">
                <thead>
                <tr>
                    <th width="40">序号</th>
                    <th>姓名</th>
                    <th>部门</th>
                    <th>职位</th>
                    <th>账号</th>
                    <th>手机号码</th>
                    <th>发送时间</th>
                    <th>查看状态</th>
                    <th>状态</th>
                    <th width="130">操作</th>
                </tr>
                </thead>
                <tbody>
                {if $lists.data}
                {foreach $lists.data as $key => $item}
                <tr>
                    <td>{$lists.per_page * ($lists.current_page - 1) + $key + 1}</td>
                    <td>{$item.nickname|default='-'}</td>
                    <td>{$item.department_name|default='-'}</td>
                    <td>{$item.position|default='-'}</td>
                    <td>{$item.username|default='-'}</td>
                    <td>{$item.mobile|default='-'}</td>
                    <td>{$item.sendtime_text|default='-'}</td>
                    <td>{$item.is_view ? '<span class="color_4873C1">已查看</span>' : '<span class="color_EF4033">未查看</span>'}</td>
                    <td class="status_{$item.status}">{$item.status_text|default='-'}</td>
                    <td>
                        <a data-id="{$payslip.id}" data-logs_id="{$item.id}" class="ck_but">查看</a> |
                        <a data-id="{$payslip.id}" data-logs_id="{$item.id}" class="edit_but">编辑</a> |
                        <a data-id="{$payslip.id}" data-logs_id="{$item.id}" class="send_but color_EF4033">重发</a>
                    </td>
                </tr>
                {/foreach}
                {/if}
                </tbody>
            </table>
            <div id="laypage" data-total="{$lists.total}" data-per_page="{$lists.per_page}" data-current_page="{$lists.current_page}"></div>
        </div>
        <div class="fsjl_tag">
            <span>发放状态 : {$payslip.status_text}</span>
            <span>总人数：{$lists.total}人</span>
            <span>已发放：{$statistics_1}条</span>
            <span>未发放：{$statistics_2}条</span>
            <span>已查看：{$statistics_3}人</span>
            <span>已反馈：{$statistics_4}人</span>
        </div>
    </div>
</div>

<div class="pop ck_pop">
    <div class="pop_content fsjl_p_content">
        <div class="layui-card-body">
            <div class="fsjl_header"><img src="__CDN__/assets/manage/images/fsjl_img01.jpg" alt=""/></div>
            <div class="fsjl_content"></div>
            <div class="fsjl_bottom"><img src="__CDN__/assets/manage/images/fsjl_img02.jpg" alt=""/></div>
        </div>
    </div>
</div>

<div class="pop edit_pop">
    <div class="pop_content fsjl_p_content">
        <div class="layui-card-body">
            <div class="fsjl_header"><img src="__CDN__/assets/manage/images/fsjl_img01.jpg" alt=""/></div>
            <div class="fsjl_content"></div>
            <div class="fsjl_bottom"><img src="__CDN__/assets/manage/images/fsjl_img04.jpg" alt=""/></div>
        </div>
    </div>
</div>

<script type="text/html" id="view_tpl">
    <div class="fsjl_title"><i class="layui-icon layui-icon-left"></i>工资条详情</div>
    <div class="fsjl_content01">
        <div class="fsjl_item">
            <h3><%=data['payslip_total']%></h3>
            <p>本月实发工资</p>
        </div>
        <div class="fsjl_item2">
            <div class="f_item_title active">{$payslip_type[$payslip['payslip_type']]|default=''}<i class="layui-icon layui-icon-up"></i></div>
            <div class="item_list show">
                <% for(i = 0; i < data['list'].length; i ++) { %>
                <div class="item">
                    <span><%=data['list'][i]['name']%></span>
                    <b><%=data['list'][i]['value']%>　</b>
                </div>
                <% } %>
            </div>
            <div class="item">
                <span>实发金额（元）</span>
                <div class="amount"><%=data['payslip_total']%></div>
            </div>
        </div>
    </div>
</script>

<script type="text/html" id="edit_tpl">
    <div class="fsjl_title"><i class="layui-icon layui-icon-left"></i>工资条详情</div>
    <div class="fsjl_content01">
        <div class="fsjl_item">
            <h3><%=data['payslip_total']%></h3>
            <p>本月实发工资</p>
        </div>
        <div class="fsjl_item2">
            <div class="f_item_title active">{$payslip_type[$payslip['payslip_type']]|default=''}<i class="layui-icon layui-icon-up"></i></div>
            <div class="item_list show">
                <% for(i = 0; i < data['list'].length; i ++) { %>
                <div class="item">
                    <span><%=data['list'][i]['name']%></span>
                    <input type="text" value="<%=data['list'][i]['value']%>" data-name="payslip_json[<%=data['list'][i]['name']%>]" class="field">
                </div>
                <% } %>
            </div>
            <div class="item">
                <span>实发金额（元）</span>
                <input type="text" value="<%=data['payslip_total']%>" data-name="payslip_total" class="amount field">
            </div>
        </div>
    </div>
    <div class="but"><a class="layui-btn save_but" data-id="<%=data['id']%>">确认修改</a></div>
</script>